vcSnapService
vcSnapService provides options for handling the position and orientation of 3D world points selected using the interactiveSnap command. Note 1: vcSnapService should not be used at the same time by multiple scripts. Note 2: vcSnapService and vcTopologyPickService should not be used at the same time.
See in: Overview
Module: vcCore
Parent: -
Children -
Referenced by: vcApplication.SnapService
Properties
Learn how to use properties here. The properties are also inherited from the parent class.
| Name | Type | Access | Description |
| SnapOnCircleCenter | Boolean | RW | Gets or sets the center of circles as potential targets. |
| SnapOnCurve | Boolean | RW | Gets or sets curves as potential targets. |
| SnapOnEdge | Boolean | RW | Gets or sets edges as potential targets. |
| SnapOnEdgeCenter | Boolean | RW | Gets or sets the midpoint of edges as potential targets. |
| SnapOnFaceCenter | Boolean | RW | Gets or sets the center of faces as potential targets. |
| SnapOnFrame | Boolean | RW | Gets or sets frames as potential targets. |
| SnapOnNodeCenter | Boolean | RW | Gets or sets the center of nodes as potential targets. |
| SnapOnNodeOrigin | Boolean | RW | Gets or sets the origin of nodes as potential targets. |
| SnapOnPoint | Boolean | RW | Gets or sets points on lines and polygons, for example corner points, as potential targets. |
| SnapOnPolygon | Boolean | RW | Gets or sets polygons as potential targets. |
| SnapOnSurface | Boolean | RW | Gets or sets faces as potential targets. |
| TargetAvailable | Boolean | R | Gets if pointing at an available target in the 3D world. |
| TargetCircleCenterAvailable | Boolean | R | Gets if center of a circle is available as a target. |
| TargetCurve | list[rVector] | R | Gets a list of positions for a target curve in World coordinate system. |
| TargetCurveAvailable | Boolean | R | Gets if a curve is available as a target. |
| TargetCurveIndex | Integer | R | Gets the index position of a target curve in a geometry set. |
| TargetFaceCenterAvailable | Boolean | R | Gets if the center of a face is available as a target. |
| TargetGeoset | vcObject | R | Gets the geometry set of a target. |
| TargetLocked | Boolean | R | Gets if a target has been selected in the 3D world. |
| TargetMatrix | vcMatrix | R | Gets the position and orientation matrix for target in World coordinates. |
| TargetMatrixAvailable | Boolean | R | Gets if the position and orientation matrix for a target is available. (only valid for frame type targets) |
| TargetNode | vcObject | R | Gets the node containing a target. |
| TargetNormal | vcVector | R | Gets the normal vector of a target in World coordinates. |
| TargetNormalAvailable | Boolean | R | Gets if the normal vector of a target is available. (only valid for polygon and frame type targets) |
| TargetPosition | vcVector | R | Gets the position of a target in World coordinates. |
| TargetSurfaceAvailable | Boolean | R | Gets if the surface of a target is available. |
| TargetSurfaceIndex | Integer | R | Gets the index position of a target surface in a component, for example the faces of a cube. |
Methods
Learn how to use methods here. The methods are also inherited from the parent class.
| Name | Return Type | Parameters | Description |
| clear | None | None | Stops and resets the command and clears its target data (in every instance of both vcTopologyPickService and vcSnapService).See moreRemoves all registered callbacks (of this script). Triggers an OnCanceled event in this script (if called from outside and event handler) and in other scripts (always). |
| execute | None | None | Runs the vcSnapService. Before calling this, make sure you call clear(). See moreThen (re)set the needed properties, (re)add the needed event handlers and finnaly call execute(). |
Events
Learn how to use events here. The events are also inherited from the parent class.
| Name | Parameters | Description |
| OnCanceled | None | Triggered when the snap action is canceled.See moreIf not provided, the default implementation calls clear(). If provided, you handler should call clear() to avoid potential issues with other scripts using vcSnapService or vcTopologyPickService. |
| OnTargetAvailable | None | Triggered when pointer is hovering over a valid target in 3D world. |
| OnTargetSet | None | Triggered when a valid target has been selected in 3D world.See moreYour handler should call clear() to avoid potential issues with other scripts using vcSnapService or vcTopologyPickService. |